<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改配件店档案')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-partsStore-edit" th:object="${zsyhUserPartsstore}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label">店铺门头：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="storeImage" th:field="*{storeImage}">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="storeImage" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">店铺名称：</label>
                <div class="col-sm-8">
                    <input name="storeName" th:field="*{storeName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">服务承诺：</label>
                <div class="col-sm-8">
                    <input name="storeService" th:field="*{storeService}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">店铺浏览量：</label>
                <div class="col-sm-8">
                    <input name="storePageviews" th:field="*{storePageviews}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">详细地址：</label>
                <div class="col-sm-8">
                    <input name="storeAddress" th:field="*{storeAddress}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">省级代码：</label>
                <div class="col-sm-8">
                    <input name="storeProvince" th:field="*{storeProvince}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">省级名称：</label>
                <div class="col-sm-8">
                    <input name="storeProvinceName" th:field="*{storeProvinceName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">城市代码：</label>
                <div class="col-sm-8">
                    <input name="storeCity" th:field="*{storeCity}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">城市名称：</label>
                <div class="col-sm-8">
                    <input name="storeCityName" th:field="*{storeCityName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">区域代码：</label>
                <div class="col-sm-8">
                    <input name="storeDistrict" th:field="*{storeDistrict}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">区域名称：</label>
                <div class="col-sm-8">
                    <input name="storeDistrictName" th:field="*{storeDistrictName}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">店铺联系人：</label>
                <div class="col-sm-8">
                    <input name="storePerson" th:field="*{storePerson}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">店铺手机号：</label>
                <div class="col-sm-8">
                    <input name="storePhone" th:field="*{storePhone}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">营业时间：</label>
                <div class="col-sm-8">
                    <input name="storeBusinessHours" th:field="*{storeBusinessHours}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">开业年限：</label>
                <div class="col-sm-8">
                    <input name="storeOpenYears" th:field="*{storeOpenYears}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">主营产品：</label>
                <div class="col-sm-8">
                    <textarea name="storeContent" class="form-control">[[*{storeContent}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">营业执照：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="storeLicense" th:field="*{storeLicense}">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="storeLicense" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">状态：</label>
                <div class="col-sm-8">
                    <select name="storeState" class="form-control m-b">
                        <option value="">所有</option>
                    </select>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">驳回原因：</label>
                <div class="col-sm-8">
                    <textarea name="storeRejectReason" class="form-control">[[*{storeRejectReason}]]</textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">关联用户表ID：</label>
                <div class="col-sm-8">
                    <input name="userId" th:field="*{userId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">大区会长ID：</label>
                <div class="col-sm-8">
                    <input name="agentId" th:field="*{agentId}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否订单管理权：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="radio" name="isRaker" value="">
                        <label th:for="isRaker" th:text="未知"></label>
                    </div>
                    <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/partsStore";
        $("#form-partsStore-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-partsStore-edit').serialize());
            }
        }

        $(".file-upload").each(function (i) {
            var val = $("input[name='" + this.id + "']").val()
            $(this).fileinput({
                'uploadUrl': ctx + 'common/uploadOSS',
                initialPreviewAsData: true,
                initialPreview: [val],
                maxFileCount: 1,
                autoReplace: true
            }).on('fileuploaded', function (event, data, previewId, index) {
                $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
            }).on('fileremoved', function (event, id, index) {
                $("input[name='" + event.currentTarget.id + "']").val('')
            })
            $(this).fileinput('_initFileActions');
        });
    </script>
</body>
</html>